<?php
/**
 * Created by PhpStorm.
 * User: zl
 * Date: 2017/5/29
 * Time: 8:59
 */
    require_once('../BusinessApprove/BusinessApp.php');
    require_once('../Common.php');
    require_once ('../PDF/PDFCreator.php');

    $appID = $_REQUEST['appID'];

    $b_app = new BusinessApp();
    $appData = $b_app->getBusinessAppPDFData($appID);

    if(!$appData){
        exit(json_encode(array('state'=>0, 'error'=>'DB_ERROR')));
    }

    $pdf = new PDFCreator();
    $u = $pdf->createBusinessApplyPDF($appData);

    $result_array['state'] = 1;
    $result_array['state_error'] = '';
    $result_array['url'] = $u;

    echo json_encode($result_array);





?>